<template>
  <!-- <img alt="Vue logo" src="../assets/logo.png" /> -->
  <div class="collects">
    <p></p>
    <!-- <ul>
      <li v-for="item in list" :key="item.id" @click="toRoute(item.url)">
        <img />
        <p>{{ item.name }}</p>
      </li>
    </ul> -->
    <a-card title="小合集" style="border-radius: 18px; padding-bottom: 15px">
      <a-card-grid
        style="width: 25%; text-align: center"
        v-for="item in list"
        :key="item.id"
        @click="toRoute(item.url)"
      >
        {{ item.name }}
      </a-card-grid>
    </a-card>
  </div>
  <!-- <HelloWorld msg="Welcome to Your Vue.js App" /> -->
</template>

<script>
// import HelloWorld from "../components/HelloWorld.vue";
import { viewCollection } from "../api/collection";
export default {
  name: "App",
  // components: {
  //   HelloWorld,
  // },
  data() {
    return {
      list: [{ name: "", url: "" }],
    };
  },
  created() {
    viewCollection().then((res) => {
      console.log(res);
      const data = res.data;
      if (data.code == 200) {
        this.list = data.list.list;
      }
    });
  },
  methods: {
    toRoute(url) {
      this.$router.replace(url);
    },
  },
};
</script>

<style>
/* #app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */
/* .collects {
  position: relative;
  border: 1px solid transparent;
  border-radius: 18px;
  width: 60%;
  height: 60%;
  top: 20px;
  margin: auto;
}
.collects ul {
  list-style: none;
}
.collects ul li {
  border: 1px solid blue;
} */
</style>
